﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using Autodesk.Revit.UI;
using YArchitech.LIB;

namespace QuickModel.InteractiveOperation
{
	public abstract class InteractiveOperationBase : IRequestMaker
	{
		public abstract bool IfBreak { get; }

		public bool IfCancel
		{
			get
			{
				return this.m_bCancel;
			}
		}

		public virtual bool IfEndCommand
		{
			get
			{
				return false;
			}
		}

		public InteractiveOperationBase(ExternalCommandData useExternalCommandData)
		{
			this.m_useExternalCommandData = useExternalCommandData;
			this.m_dwgEntitiesSelection = new DwgEntitiesSelection(useExternalCommandData.Application.ActiveUIDocument);
			Process currentProcess = Process.GetCurrentProcess();
			IntPtr mainWindowHandle = currentProcess.MainWindowHandle;
			this.m_handleRevit = new YJKWindowHandle(mainWindowHandle);
		}

		public abstract void CloseFrom();

		public abstract List<InputRequest> GetAllInputRequest();

		public abstract void PrepareRequest();

		protected ExternalCommandData m_useExternalCommandData = null;

		protected DwgEntitiesSelection m_dwgEntitiesSelection = null;

		protected bool m_bCancel = false;

		protected YJKWindowHandle m_handleRevit = null;
	}
}
